package com.renjiyue.dao;

import com.renjiyue.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserDaoImpl implements UserDao{
    //sqlSession不用我们自己创建，Spring来管理
    private SqlSessionTemplate sqlSession;
    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession = sqlSession;
    }

    @Override
    public List<User> selectUser() {
        UserDao mapper = sqlSession.getMapper(UserDao.class);
        return mapper.selectUser();
    }
}
